<template>
  <div class="member-home">
    <MemberHomeOverview></MemberHomeOverview>
    <!-- 收藏 -->
    <MemberHomePanel title="我的收藏">
      <GoodsItem v-for="i in collectGoods" :key="i.id" :goods="i"></GoodsItem>
    </MemberHomePanel>
    <!-- 足迹 -->
    <MemberHomePanel title="我的足迹"></MemberHomePanel>
    <!-- 猜你 -->
    <GoodsRelevant />
  </div>
</template>
<script>
import MemberHomeOverview from './components/home-overview.vue'
import MemberHomePanel from './components/home-panel.vue'
import GoodsRelevant from '@/views/goods/components/goods-relevant'
import GoodsItem from '../../category/component/goods-item.vue'
import { ref } from 'vue'
import { findCollect } from '@/api/member.js'

export default {
  name: 'MemberHome',
  components: {
    MemberHomeOverview,
    MemberHomePanel,
    GoodsRelevant,
    GoodsItem
  },
  setup() {
    // const goods = reactive({
    //   id: '1',
    //   name: '自煮火锅不排队 麦饭石不粘鸳鸯火锅',
    //   picture:
    //     'https://yanxuan-item.nosdn.127.net/fcdcb840a0f5dd754bb8fd2157579012.jpg',
    //   desc: '清汤鲜香 红汤劲爽',
    //   price: '159.00'
    // })
    // // 调用模拟接口
    // request('/my/test', 'get').then((data) => {
    //   console.log(data)
    // })
    const collectGoods = ref()
    findCollect({
      page: 1,
      pagesize: 4
    }).then((data) => {
      collectGoods.value = data.result.items
    })
    return { collectGoods }
  }
}
</script>
<style scoped lang="less"></style>
